package com.abredatos.t37.lab;

import java.io.File;

import static org.junit.Assert.*;

class ParseStations {

	void testParseStations() {
		
		def stationList = [:]
		def stationListFileName = 'stations.txt'
		
		File stationListFile = new File(stationListFileName)
		if (!stationListFile.exists()) {
			println "File does not exist"
		} else {
			stationListFile.eachLine {
				line -> 
				if (line.trim()) {
					def (key,value) = line.split('=')
					stationList."$key" = value
				}
			}
		}
		
		stationList.each { k, v ->
			println "Station $k at $v"
		}
	}
	
}
